<?php

class Application_Form_SearchSubfolder extends Zend_Form
{

    public function init()
    {
    	$this->setMethod('post')
    		->setAttrib('id', 'searchSubfolderForm');
    	
    	$this->clearDecorators();
    	
    	$decorators = array(
    			array('ViewHelper'),
    			array('Errors'),
    			array('Label', array('requiredSuffix' => ' *', 'class' => 'leftalign')),
    			array('HtmlTag', array('tag' => 'li')),
    	);
    	
    	$subfolderName = $this->addElement('text', 'name',
    			array('label' => 'Subfolder Name'));
    	$subfolderName = $this->getElement('name')
    		->setRequired(true)
    		->addFilter('StringTrim');
    	$subfolderName->setDecorators($decorators);
    	
    	$enable = $this->addElement('submit', 'enable',
    			array('label' => 'Enable Access'));
    	$enable = $this->getElement('enable')
    		->setDecorators(array(
    			array('ViewHelper'),
    	));
    	
    	$disable = $this->addElement('submit', 'disable',
    			array('label' => 'Disable Access'));
    	$disable = $this->getElement('disable')
    		->setDecorators(array(
    			array('ViewHelper'),
    	));
    	
    	$this->addDisplayGroup(array('enable', 'disable'), 'submit_buttons',
    			array('disableLoadDefaultDecorators' => true));
    	$submitButtons = $this->getDisplayGroup('submit_buttons');
    	$submitButtons->addDecorators(array(
    			array('FormElements', 'Form'),
    			array('HtmlTag', array('tag' => 'li', 'class' => 'submit')),
    	));
    	
    	$this->setDecorators(array(
    			'FormElements',
    			array('HtmlTag', array('tag' => 'ul')),
    			array(array('DivTag' => 'HtmlTag'),
    					array('tag' => 'div', 'id' => 'searchSubfolderDiv')),
    			'Form'
    	));
    }


}

